package backend

import "github.com/gogf/gf/v2/frame/g"

type AttachmentIndexReq struct {
	g.Meta `path:"/attachment/index" method:"get" summary:"资源列表页面" tags:"资源"`
}

type AttachmentIndexRes struct {
	g.Meta `mime:"text/html" type:"string" example:"<html/>"`
}

// AttachmentListReq 获取资源数据
type AttachmentListReq struct {
	g.Meta `path:"/attachment/list" method:"get" summary:"获取资源列表数据" tags:"资源"`
	Name   string `json:"name"`
	Status int    `json:"status"`
	CommonPaginationReq
}

// AttachmentListRes 获取资源数据返回
type AttachmentListRes struct {
	Data interface{} `json:"data"`
	CommonPaginationRes
}

// 资源创建

type AttachmentShowCreateReq struct {
	g.Meta `path:"/attachment/create" method:"get" summary:"新增资源" tags:"资源"`
}

type AttachmentShowCreateRes struct {
	g.Meta `mime:"text/html" type:"string" example:"<html/>"`
}

type AttachmentCreateReq struct {
	g.Meta       `path:"/attachment/create" method:"post" summary:"资源创建" tags:"资源"`
	CateId       uint   `json:"cate_id" v:"required#请选择分类"`
	Drive        string `json:"drive"`
	UploadType   string `json:"upload_type"`
	SpecificType string `json:"specific_type"`
	Path         string `json:"path" v:"required#请先上传文件"`
	Name         string `json:"name"`
	Status       int    `json:"status"`
}

type AttachmentCreateRes struct {
	AttachmentId uint `json:"attachment_id"`
}

// 资源修改

type AttachmentShowUpdateReq struct {
	g.Meta `path:"/attachment/update/{Id}" method:"get" summary:"资源修改页面" tags:"资源"`
	Id     uint `json:"id"`
}

type AttachmentShowUpdateRes struct {
	g.Meta `mime:"text/html" type:"string" example:"<html/>"`
}

type AttachmentUpdateReq struct {
	g.Meta       `path:"/attachment/update/{Id}" method:"post" summary:"资源修改" tags:"资源"`
	Id           uint   `json:"id"      v:"min:1#请选择需要修改的资源" dc:"资源Id"`
	CateId       uint   `json:"cate_id" v:"required#请选择分类"`
	Drive        string `json:"drive"`
	UploadType   string `json:"upload_type"`
	SpecificType string `json:"specific_type"`
	Path         string `json:"path" v:"required#请先上传文件"`
	Name         string `json:"name"`
	Status       int    `json:"status"`
}

type AttachmentUpdateRes struct{}

// 资源删除

type AttachmentDeleteReq struct {
	g.Meta `path:"/attachment/delete/{Id}" method:"post" summary:"资源删除" tags:"资源"`
	Id     uint `json:"id"`
}

type AttachmentDeleteRes struct{}

// 资源查看

type AttachmentShowViewReq struct {
	g.Meta `path:"/attachment/view/{Id}" method:"get" summary:"资源查看页面" tags:"资源"`
	Id     uint `json:"id"      v:"min:1#请选择需要查看的资源" dc:"资源Id"`
}

type AttachmentShowViewRes struct {
	g.Meta `mime:"text/html" type:"string" example:"<html/>"`
}
